﻿namespace ClassLibrary.BusinessLayer.Facade
{
    using ClassLibrary.BusinessLayer.BusinessObjects;
    using ClassLibrary.DataLayer.DataObjects;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.Common;

    [DataObject(true)]
    public class ProcedureTmpltFacade
    {
        private IProcedureTmpltDAO procedureTmpltDAO = DAOAccess.ProcedureTmpltDAO;

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public bool AddProcedureTmplt(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.InsertProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public int AddProcedureTmpltAndReturnIdentity(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.InsertProcedureTmpltReturnIdentity(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Insert)]
        public string AddProcedureTmpltAndReturnOutput(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.InsertProcedureTmpltReturnOutput(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Delete)]
        public bool DeleteProcedureTmplt(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.DeleteProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProcedureTmplt> GetProcedureTmplt(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.GetProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProcedureTmplt> GetProcedureTmplt(string procedureTmplt)
        {
            ProcedureTmplt clsProcedureTmplt = new ProcedureTmplt();
            clsProcedureTmplt._HeadingCode = procedureTmplt;
            return this.procedureTmpltDAO.GetProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProcedureTmplt> GetsProcedureTmplt()
        {
            return this.procedureTmpltDAO.GetsProcedureTmplt();
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public DataTable GetsProcedureTmplt(string SPName, DbParameter[] param)
        {
            return this.procedureTmpltDAO.GetsProcedureTmplt(SPName, param);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProcedureTmplt> ListProcedureTmplt(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.ListProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IList<ProcedureTmplt> ListProcedureTmplt(string procedureTmplt)
        {
            ProcedureTmplt clsProcedureTmplt = new ProcedureTmplt();
            clsProcedureTmplt._HeadingCode = procedureTmplt;
            return this.procedureTmpltDAO.ListProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Update)]
        public bool UpdateProcedureTmplt(ProcedureTmplt clsProcedureTmplt)
        {
            return this.procedureTmpltDAO.UpdateProcedureTmplt(clsProcedureTmplt);
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public int UpdateProcedureTmplt(string SPName, DbParameter[] param)
        {
            return this.procedureTmpltDAO.UpdateProcedureTmplt(SPName, param);
        }
    }
}

